package com.neulogistics.core.customercenter.domain.model.aggregate;

import com.neulogistics.core.customercenter.domain.model.valueobject.Address;
import com.neulogistics.infrastructure.ddd.domain.seedwork.Entity;
import com.neulogistics.infrastructure.ddd.domain.seedwork.IAggregateRoot;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
public class Customer extends Entity<Integer> implements IAggregateRoot {

    /**
     * 客户id
     */
    private Integer customerId;

    /**
     * 客户名
     */
    private String customerName;

    /**
     * 单位名
     */
    private String flatsName;

    /**
     * 身份证号
     */
    private String customerIdentity;

    /**
     * 客户电话
     */
    private String customerPhone;

    /**
     * 收货地址
     */
    private Address receiverAddress;

    /**
     * 邮件地址
     */
    private String customerEmail;

    /**
     * 座机号
     */
    private String customerLandline;

    /**
     * 是否删除
     */
    private Integer deleted;

    public Customer() {
    }

    public Customer(String customerName, String flatsName,
                    String customerIdentity, String customerPhone, Address receiverAddress,
                    String customerEmail, String customerLandline) {
        this.customerName = customerName;
        this.flatsName = flatsName;
        this.customerIdentity = customerIdentity;
        this.customerPhone = customerPhone;
        this.receiverAddress = receiverAddress;
        this.customerEmail = customerEmail;
        this.customerLandline = customerLandline;

        // TODO 生成新增客户领域事件
    }
}
